import paramiko

transport = paramiko.Transport(('114.115.248.128',6666))
transport.connect(username='root',password='Esxi0000.')
sftp = paramiko.SFTPClient.from_transport(transport)

#上传
# sftp.put('C:/Users/12183/OneDrive/桌面/asr_db.sql','/root/asr_db.sql')

#下载
# local = '/root/pythonTest.txt'
# dir2 = 'C:\\Users\\12183\\IdeaProjects\\jaina-home\\test\\pythonTest.txt'
# sftp.get(local,dir2)

fileSize = sftp.stat('/root/test.sh')
fileSize = fileSize.__str__().split()
print(fileSize[4] , "B")
# print(sftp.__getattribute__('/root/'))
# print(sftp.listdir_attr('/root/'))
# dirlist = sftp.listdir_iter(rootDir)
# dirlist = sftp.listdir_attr(rootDir)

sftp.close()